package LuMin.timer.impl;

/**
 * @author lumin
 * @date 2022/04/27 19:20
 **/
public class Main {
    public static void main(String[] args) {
        MyTimerTask t1 = new MyTimerTask() {
            @Override
            public void run() {
                System.out.println("5s 之后");
            }
        };

        MyTimerTask t2 = new MyTimerTask() {
            @Override
            public void run() {
                System.out.println("4s 之后");
            }
        };

        MyTimerTask t3 = new MyTimerTask() {
            @Override
            public void run() {
                System.out.println("3s 之后");
            }
        };

        MyTimerTask t4 = new MyTimerTask() {
            @Override
            public void run() {
                System.out.println("2s 之后");
            }
        };

        MyTimerTask t5 = new MyTimerTask() {
            @Override
            public void run() {
                System.out.println("1s 之后");
            }
        };

        MyTimer myTimer = new MyTimer();
        myTimer.schedule(t1, 5000);
        myTimer.schedule(t2, 4000);
        myTimer.schedule(t3, 3000);
        myTimer.schedule(t4, 2000);
        myTimer.schedule(t5, 1000);
    }
}